// --------------------------------------------------------------------------------------------------------------------
// <copyright file="GetSensorInfo.cs" company="Microsoft Corporation">
// The MIT License (MIT)
// 
// Copyright (c) 2014, Microsoft Corporation
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace Microsoft.Robotics.Hardware.EV4
{
    using System;
    using System.IO;

    using Microsoft.Robotics.Hardware.DAC;

    /// <summary>
    /// The get sensor info class
    /// </summary>
    public class GetSensorInfo : CommandMessage<byte[]>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="GetSensorInfo"/> class.
        /// </summary>
        public GetSensorInfo()
            : base((byte)CommandId.GetSensorInfo)
        {
        }

        /// <summary>
        /// Gets a value indicating whether this instance is response required.
        /// </summary>
        /// <value>
        /// <c>true</c> if a response is required; otherwise, <c>false</c>.
        /// </value>
        public override bool IsResponseRequired
        {
            get
            {
                return true;
            }
        }

        /// <summary>
        /// Parses the parameters.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <returns>The sensor data</returns>
        public override byte[] ParseParameters(BinaryReader reader)
        {
            return reader.ReadBytes(128);
        }

        /// <summary>
        /// Not used
        /// </summary>
        public override void Cancel()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Not used
        /// </summary>
        /// <param name="reader">The parameter is not used</param>
        public override void ParseResponse(BinaryReader reader)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Writes the parameters.
        /// </summary>
        /// <param name="writer">The writer.</param>
        protected override void WriteParameters(BinaryWriter writer)
        {
            // None to write
        }
    }
}
